package com.java.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
/**
 * 收入支出情况
 * @author Administrator
 *
 */
@Entity
@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true, 
		dynamicInsert = true, 
		dynamicUpdate = true
)
@Table(name="income_expenses")
public class IncomeExpenses implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8610833522850522897L;
	@Id
	@GeneratedValue
	private Long id;
	
	/**
	 * 所属订单
	 */
	@ManyToOne
	@NotFound(action=NotFoundAction.IGNORE)
	private OrderForm order;
	
	/**
	 * 项目
	 */
	@Column(length=100)
	private String cooperFactory;
	
	/**
	 * 类别:true-收入,false-支出
	 */
	@Column
	private Boolean type;
	
	/**
	 * 金额
	 */
	@Column(nullable=true)
	private Double amount=0d;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public OrderForm getOrder() {
		return order;
	}

	public void setOrder(OrderForm order) {
		this.order = order;
	}

	public String getCooperFactory() {
		return cooperFactory;
	}

	public void setCooperFactory(String cooperFactory) {
		this.cooperFactory = cooperFactory;
	}

	public Boolean getType() {
		return type;
	}

	public void setType(Boolean type) {
		this.type = type;
	}

	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}
	
}
